﻿@model Resto.CostControl.Core.DishDelivery
<div class="pageContent">
    @using (Html.DWZBeginForm())
    { 
        <div class="pageFormContent" layouth="56">
            @Html.HiddenFor(model => model.Id)
            @Html.DWZTextBoxFor(model => model.Code).Required()
            @Html.DWZDateFor(model => model.Date).Required()
            @Html.DWZDropDownListFor(model => model.SiteID, "ProjectSite").Required()
            @Html.DWZTextBoxFor(model => model.State).Required()
            @Html.DWZTextBoxFor(model => model.Address).Required()
            @Html.DWZTextAreaFor(model => model.Remark)
            <div class="divider">
            </div>
            <table class="list nowrap itemDetail" addbutton="新建记录" width="100%">
                <thead>
                    <tr>
                        <th type="lookup" name="dwz.items[#index#].Code" lookupgroup="items[#index#]"
                            lookupurl="@Url.Action("LookupMaterial", "Material")" size="15">
                            品名编号
                        </th>
                        <th type="text" name="dwz.items[#index#].Name" size="20" fieldclass="required">
                            品名名称
                        </th>
                        <th type="text" name="dwz.items[#index#].Price" size="20" fieldclass="number">
                            品名价格
                        </th>
                        <th type="text" name="dwz.items[#index#].OrderCount" size="20" fieldclass="number">
                            订购数
                        </th>
                        <th type="text" name="dwz.items[#index#].SignCount" size="20" fieldclass="number">
                            签收数
                        </th>
                        <th type="del" width="25">
                            <hi:text key="操作" />
                        </th>
                    </tr>
                </thead>
                <tbody>
                    @for (int index = 0; index < Model.Items.Count; index++)
                    {
                        Resto.CostControl.Core.DishDeliveryItem item = Model.Items.ElementAt(index);
                        <tr class="unitBox">
                            <td>
                                @Html.Hidden("items[" + index + "].id", item.Id)
                                @Html.TextBox("dwz.items[" + index + "].Code", item.Code, new { size = "15" })
                                <a title="查找带回" lookupgroup="items[@index]" href="@Url.Action("LookupMaterial", "Material")" class="btnLook">
                                    查找带回</a>
                            </td>
                            <td>
                                @Html.TextBox("dwz.items[" + index + "].Name", item.Name, new { size = "20" })
                            </td>
                            <td>
                                @Html.TextBox("dwz.items[" + index + "].Price", item.Price, new { size = "20" })
                            </td>
                            <td>
                                @Html.TextBox("dwz.items[" + index + "].OrderCount", item.OrderCount, new { size = "20" })
                            </td>
                            <td>
                                @Html.TextBox("dwz.items[" + index + "].SignCount", item.SignCount, new { size = "20" })
                                @Html.Hidden("dwz.items[" + index + "].DeliveryCount", item.DeliveryCount)
                            </td>
                            <td>
                                <a href="@Url.Action("DeleteItem")/@item.Id" class="btnDel" title="您确定要删除服务端的记录吗?">删除</a>
                            </td>
                        </tr>
                    }
                </tbody>
            </table>
        </div>
        @Html.DWZFormBar()
    }
</div>
